package com.yijinsuo.response;

import com.yijinsuo.entity.RedList;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

/**
 * Created by ekikousei易皇星 on 16/12/7.
 * E-mail:13764664731@163.com
 * Signature:缘分是本书,翻的不经意会错过,读的太认真会流泪!!
 * <p/>
 * TODO:类描述:
 */
public class PayHongBaoRes {
    private ArrayList<RedList> redList;
    private String borrowEId;
    private String tenderAmount;
    private String publickey;


    public PayHongBaoRes () {

    }

    public PayHongBaoRes (JSONObject json) {


        this.redList = new ArrayList<RedList>();
        JSONArray arrayRedList = json.optJSONArray("redList");
        if (null != arrayRedList) {
            int redListLength = arrayRedList.length();
            for (int i = 0; i < redListLength; i++) {
                JSONObject item = arrayRedList.optJSONObject(i);
                if (null != item) {
                    this.redList.add(new RedList(item));
                }
            }
        }
        else {
            JSONObject item = json.optJSONObject("redList");
            if (null != item) {
                this.redList.add(new RedList(item));
            }
        }

        this.borrowEId = json.optString("borrowEId");
        this.tenderAmount = json.optString("tenderAmount");
        this.publickey = json.optString("publickey");

    }

    public ArrayList<RedList> getRedList() {
        return this.redList;
    }

    public void setRedList(ArrayList<RedList> redList) {
        this.redList = redList;
    }

    public String getBorrowEId() {
        return this.borrowEId;
    }

    public void setBorrowEId(String borrowEId) {
        this.borrowEId = borrowEId;
    }

    public String getTenderAmount() {
        return this.tenderAmount;
    }

    public void setTenderAmount(String tenderAmount) {
        this.tenderAmount = tenderAmount;
    }

    public String getPublickey() {
        return this.publickey;
    }

    public void setPublickey(String publickey) {
        this.publickey = publickey;
    }

}
